from django.db import models

# Create your models here.



class RoomMaster(models.Model):
    """
    房间
    """
    name = models.CharField(verbose_name="名字", max_length=50)
    uuid = models.CharField(verbose_name="房间编号", max_length=256)
    type = models.ForeignKey('RoomType', on_delete=models.SET_NULL, null=True, blank=True)
    floor = models.ForeignKey('RoomFloor', on_delete=models.CASCADE, null=True, blank=True)
    sort = models.IntegerField(verbose_name="排序", null=True, default=0)
    status = models.IntegerField(verbose_name="状态", null=True, default=0)  # 0.维护中 1.正常
    imgPath = models.CharField(verbose_name="房间图片", max_length=512, null=True, blank=True)

class RoomType(models.Model):
    """
    房间类型
    """
    name = models.CharField(verbose_name="名字", max_length=50)
    sort = models.IntegerField(verbose_name="排序", null=True, default=0)
    describe = models.CharField(verbose_name="描述", max_length=512, null=True, blank=True)


class RoomFloor(models.Model):
    """
    房间楼层
    """
    name = models.CharField(verbose_name="名字", max_length=50)
    sort = models.IntegerField(verbose_name="排序", null=True, default=0)
    describe = models.CharField(verbose_name="描述", max_length=512, null=True, blank=True)
